package com.hakim.wfb.customer.enums;

/**
 * 是否可以购票
 * Created by caochong on 2016/6/13.
 */
public enum IsBuyEnum {
    NO(0, "否"),
    YES(1, "是");

    private int code;

    private String message;

    private IsBuyEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }


    public static IsBuyEnum getByCode(int code) {
        IsBuyEnum[] codes = values();
        for (IsBuyEnum each : codes) {
            if (each.code == code) {
                return each;
            }
        }
        return null;
    }
}
